
#ifndef __CE_GFX_MULTIMESH_H__
#define __CE_GFX_MULTIMESH_H__

#include <export.h>
#include <iobject.h>
#include <gfx/enum.h>
#include <math/boundingbox.h>
#include <vector>

struct iIndexBuffer;
struct iVertexBuffer;
struct iVertexDeclaration;

/**
 * \addtogroup graphics
 */

/**
 * @brief Low level implementation of a mesh with several vertex buffers
 */
class CE_API ceMultiMesh : public iObject
{
  CE_OBJECT
private:
  std::vector<iVertexBuffer*>	_vertices;
  iIndexBuffer*								_indices;
  iVertexDeclaration*					_vertexDeclaration;
  unsigned										_primCount;
  ceDataType									_indexDataType;
  ceBoundingBox								_bbox;
public:
  ceMultiMesh();

  void SetNumberOfTrigons (unsigned numberOfTrigons);
  unsigned GetNumberOfTrigons () const;

  void SetNumberOfLines (unsigned numberOfLines);
  unsigned GetNumberOfLines () const;

  unsigned GetNumberOfPrims () const;

  void Set32BitIndices (bool bit32);
  bool Is32BitIndices () const;
  ceDataType GetIndexDataType () const;

	unsigned GetNumberOfVertexBuffers () const;
	void AddVertices (iVertexBuffer* vertices);
  void SetVertices (unsigned idx, iVertexBuffer* vertices);
  iVertexBuffer* GetVertices (unsigned idx);
  const iVertexBuffer* GetVertices (unsigned idx) const;

  void SetIndices (iIndexBuffer* indices);
  iIndexBuffer* GetIndices ();
  const iIndexBuffer* GetIndices () const;

  void SetVertexDeclaration (iVertexDeclaration* vertexDeclaration);
  iVertexDeclaration* GetVertexDeclration ();
  const iVertexDeclaration* GetVertexDeclration () const;

  void SetBoundingBox (const ceBoundingBox& bbox);
  ceBoundingBox& GetBoundingBox ();
  const ceBoundingBox& GetBoundingBox () const;
};




#endif /* ! __CE_GFX_MESH_H__ */
